<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

    <title>我的课程</title>

    <link href="/static/yonghu/AmazeUI-2.4.2.assets.css/admin.css" rel="stylesheet" type="text/css">
    <link href="https://cdn.bootcss.com/amazeui/2.5.1/css/amazeui.css" rel="stylesheet" type="text/css"/>

    <link href="/static/yonghu/css/personal.css" rel="stylesheet" type="text/css">
    <link href="/static/yonghu/css/colstyle.css" rel="stylesheet" type="text/css">

    <script type="text/javascript" th:src="@{/static/lib/jquery/1.9.1/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/static/lib/layer/2.4/layer.js}"></script>
    <script type="text/javascript" th:src="@{/static/lib/laypage/1.2/laypage.js}"></script>
    <link rel="stylesheet" th:href="@{/static/lib/bootstrap/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/static/css/styles-2016121272249.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/static/lib/laypage/1.2/skin/laypage.css}">

</head>

<body>
<!--头 -->
<header>
    <article>
        <div class="mt-logo">
            <!--顶部导航条 -->

            <!--悬浮搜索框-->

            <div class="clear"></div>
        </div>
        </div>
    </article>
</header>
<div class="nav-table">
    <div class="long-title"><span class="all-goods">我发布的课程</span></div>
</div>
<b class="line"></b>
<div class="center">
    <div class="col-main">
        <div class="main-wrap">

            <div class="user-collection">
                <!--标题 -->
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">我发布的课程</strong> /
                        <small>My&nbsp;Course</small>
                    </div>
                </div>
                <hr/>

                <div class="you-like">
                    <div class="s-bar">
                        <a class="am-badge am-badge-danger am-round" onclick="getCourseList(1)">已上线</a>
                        <a class="am-badge am-badge-danger am-round" onclick="getCourse(0)">待审核</a>
                        <a class="am-badge am-badge-danger am-round" onclick="getCourseList(2)">不通过</a>
                    </div>
                    <div class="s-content" id="list">
                        <div class="s-item-wrap" v-for="(item,index) in result">
                            <div class="s-item">
                                <div class="s-pic">
                                    <a href="#" class="s-pic-link">
                                        <img :src="item.courseCover" alt="课程封面" class="s-pic-img s-guess-item-img">
                                    </a>
                                </div>
                                <div class="s-info">
                                    <div class="s-title"><a href="#">{{item.courseName}}</a>
                                    </div>
                                    <div class="s-price-box">
                                        <span class="s-price"><em class="s-price-sign">¥</em><em
                                                class="s-value">{{item.coursePrice}}</em></span>
                                    </div>
                                    <div class="s-extra-box">
                                        <span class="s-comment">好评率: {{item.courseFavorateRate}}</span>
                                    </div>
                                    <div class="s-price-box">
                                        <span class="s-price"><em class="s-value">{{item.courseFlag}}</em></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--底部-->
    </div>

    <aside class="menu">
        <ul>
            <li class="person">
                <a th:href="@{/toKeCheng}">我的课程</a>
            </li>
            <li class="person">
                <a th:href="@{/toInfo}">个人资料</a>
            </li>
            <li class="person">
                <a th:href="@{/toShouRu}">我的收益明细</a>
            </li>
            <li class="person">
                <a  href="javascript:void (0)" id="money">我的钱包</a>
            </li>
        </ul>
    </aside>
</div>

</body>
<script th:src="@{/static/lib/vue.min.js}"></script>
<script th:inline="javascript">
    var app = new Vue({
        el: '#list',
        data: {
            result: []
        }
    });
    var getCourseList = function (flag) {
        $.ajax({
            url: "/getCouList",
            type: "post",
            dataType: "json",
            data: {
                courseFlag: flag || -1
            },
            success: function (data) {
                app.result = data;
            }
        })
    };
    getCourseList()
    var getCourse=function (flag) {
        $.ajax({
            url: "/getCouList",
            type: "post",
            dataType: "json",
            data: {
                courseFlag: flag
            },
            success: function (data) {
                app.result = data;
            }
        })
    }
    $("#money").click(function () {
        layer.open({
            type: 2,
            title: '我的钱包',
            fix: false,
            maxmin: true,
            shadeClose: true,
            area: ['1000px', '600px'],
            content: '/toWallet?id='+[[${session.teacher.teacherId}]]
        });
    })
</script>

</html>